ALMaSS  1.0
The Animal, Landscape and Man Simulation System
Hare_Young Class Reference

Class for young hares (low mobility, milk and solid food inputs) More...

#include <hare_all.h>

Inheritance diagram for Hare_Young:
Hare_Infant THare TAnimal TALMaSSObject

Public Member Functions

virtual void BeginStep (void)
 BeginStep for Hare_Young. More...
 
virtual void Step (void)
 Step code for Hare_Young. More...
 
virtual void EndStep (void)
 EndStep code for Hare_Young. More...
 
 Hare_Young (int p_x, int p_y, Landscape *p_L, THare_Population_Manager *p_PPM, double p_weight)
 Constructor for Hare_Young. More...
 
void ReInit (struct_Hare a_data)
 Young object reinitiation. More...
 
void Init (double p_weight)
 Object initiation. More...
 
virtual ~Hare_Young ()
 Destructor for Hare_Young. More...
 
virtual void ON_Dead ()
 This hare has been killed. More...
 
- Public Member Functions inherited from Hare_Infant
 Hare_Infant (int p_x, int p_y, Landscape *p_L, THare_Population_Manager *p_PPM)
 Hare infant constructor. More...
 
void ReInit (struct_Hare a_data)
 Infant object reinitiation. More...
 
void Init ()
 Object initiation. More...
 
virtual ~Hare_Infant ()
 Hare infant destructor. More...
 
void ON_BeingFed (double a_someMilk)
 Get energy from milk given. More...
 
void SetWeight (double w)
 Set the weight. More...
 
void SetMum (Hare_Female *a_af)
 Set the mother pointer. More...
 
- Public Member Functions inherited from THare
 THare (int p_x, int p_y, Landscape *p_L, THare_Population_Manager *p_PPM)
 Constructor. More...
 
void THareInit (int p_x, int p_y, THare_Population_Manager *p_PPM)
 Object Initiation. More...
 
virtual ~THare ()
 Destructor. More...
 
double GetWeight ()
 
double GetTotalWeight ()
 Provide the wet weight of the hare. More...
 
int GetAge ()
 
void ON_MumDead (Hare_Female *a_Mum)
 Inform Mum that we are dead. More...
 
void SetMum (Hare_Female *)
 Set the mother pointer. Reimplemented in Hare_Infant. More...
 
Hare_FemaleGetMum ()
 Get the mother pointer. More...
 
double GetRMR ()
 Get todays RMR. More...
 
virtual bool WasPredated ()
 Test for predation. More...
 
int GetRefNum ()
 Get the refnum for this hare. More...
 
void loadVegPalatability (void)
 Loads static member m_vegPalatability with data. More...
 
- Public Member Functions inherited from TAnimal
unsigned SupplyFarmOwnerRef ()
 
AnimalPosition SupplyPosition ()
 
APoint SupplyPoint ()
 
int SupplyPolygonRef ()
 
int Supply_m_Location_x ()
 
int Supply_m_Location_y ()
 
virtual void KillThis ()
 
virtual void CopyMyself ()
 
void SetX (int a_x)
 
void SetY (int a_y)
 
 TAnimal (int x, int y, Landscape *L)
 
virtual void ReinitialiseObject (int x, int y, Landscape *L)
 Used to re-use an object - must be implemented in descendent classes. More...
 
virtual int WhatState ()
 
virtual void Dying ()
 
void CheckManagement (void)
 
void CheckManagementXY (int x, int y)
 
- Public Member Functions inherited from TALMaSSObject
int GetCurrentStateNo ()
 Returns the current state number. More...
 
void SetCurrentStateNo (int a_num)
 Sets the current state number. More...
 
bool GetStepDone ()
 Returns the step done indicator flag. More...
 
void SetStepDone (bool a_bool)
 Sets the step done indicator flag. More...
 
virtual void ReinitialiseObject ()
 Used to re-use an object - must be implemented in descendent classes. More...
 
 TALMaSSObject ()
 The constructor for TALMaSSObject. More...
 
virtual ~TALMaSSObject ()
 The destructor for TALMaSSObject. More...
 
void OnArrayBoundsError ()
 Used for debugging only, tests basic object properties. More...
 

Protected Member Functions

TTypeOfHareState st_Developing ()
 Developmental code for the young hare. More...
 
TTypeOfHareState st_Dispersal ()
 Not used. More...
 
TTypeOfHareState st_Foraging ()
 Young foraging. More...
 
void st_NextStage ()
 Maturation to Hare_Juvenile. More...
 
TTypeOfHareState st_Resting ()
 Resting. More...
 
bool OnFarmEvent (FarmToDo event)
 Response to farm actions. More...
 
- Protected Member Functions inherited from Hare_Infant
TTypeOfHareState st_Developing ()
 Developmental behaviour for the infant hare. More...
 
void st_NextStage ()
 'mature' to become a young More...
 
- Protected Member Functions inherited from THare
bool Run (int a_dist, int a_direction)
 Run a distance in a direction. More...
 
void EnergyBalance (TTypeOfActivity a_activity, int dist)
 Adjust energy balance for an activity. More...
 
void TimeBudget (TTypeOfActivity a_activity, int dist)
 Adjust time budger for an activity. More...
 
void st_Dying ()
 Tidy up before removing the object on death. More...
 
virtual void Running (int a_max_dist)
 Run. More...
 
void Walking (int a_dist, int a_direction)
 Walking. More...
 
double Forage (int &time)
 Foraging. More...
 
double ForageP (int &time)
 Foraging but also incorporating pesticide exposure. More...
 
virtual void InternalPesticideHandlingAndResponse ()
 Handles internal effects of pesticide exposure. If any effects are needed this method must be re-implemented by descendent classes. More...
 
virtual void GeneralEndocrineDisruptor (double)
 Handles internal effects of endocrine distrupter pesticide exposure. If any effects are needed this method must be re-implemented by descendent classes. More...
 
virtual void GeneralOrganoPhosphate (double)
 Handles internal effects of organophosphate pesticide exposure. If any effects are needed this method must be re-implemented by descendent classes. More...
 
double ForageSquare (int a_x, int a_y)
 Forage from an area. More...
 
double ForageSquareP (int a_x, int a_y, double *a_pestexposure)
 Forage from an area and resturn pesticide exposure as well as food. More...
 
int GetPegDistance ()
 Get peg distance. More...
 
int GetPegPull ()
 Get attractive force of peg. More...
 
int GetPegDirection ()
 Get direction of peg. More...
 
void MovePeg ()
 Move the peg according to attraction forces. More...
 
- Protected Member Functions inherited from TAnimal
void CorrectWrapRound ()
 Corrects wrap around co-ordinate problems. More...
 

Additional Inherited Members

- Static Public Attributes inherited from THare
static double * m_vegPalatability = NULL
 Will hold and array of palatability for hare for each tov type. Most are 1, but unpalatable vegetation can be specified here. More...
 
- Protected Attributes inherited from THare
TTypeOfHareState m_CurrentHState
 Defines the current activity. More...
 
int m_Age
 State variale - hare age. More...
 
Hare_Object m_Type
 State variale - the type of hare. More...
 
double m_weight
 State variale - hare weight g. More...
 
double m_old_weight
 State variale - last hare weight. More...
 
Hare_Femalem_MyMum
 Pointer to the hare's mum. More...
 
THare_Population_Managerm_OurPopulationManager
 Pointer to the hare population manager. More...
 
int m_Lifespan
 Physiolocal lifespan, assuming nothing else kills the hare (unlikely to reach this age) More...
 
int m_ActivityTime
 Minutes of potential activity time per day. More...
 
int m_StarvationDays
 State variable - the number of consecutive days in negative energy balance. More...
 
double m_fatReserve
 State variable - the energy reserve of the hare. More...
 
double m_TodaysEnergy
 State variable - the amount of energy available today, can be in deficit. More...
 
double m_EnergyMax
 State variable - the amount of energy it is possible to eat as a multiplyer or RMR. More...
 
double m_KJRunning
 KJ/m cost of running per kg hare. More...
 
double m_KJWalking
 KJ/m cost of walking per kg hare. More...
 
double m_KJForaging
 KJ/m cost of foraging per kg hare. More...
 
double m_SpeedRunning
 m/min speed of running per kg hare More...
 
double m_SpeedWalking
 m/min speed of walking per kg hare More...
 
double m_foragingenergy
 Energy obtained from foraging/feeding. More...
 
int m_peg_x
 peg x-coordinate More...
 
int m_peg_y
 peg y-coordinate More...
 
int m_RefNum
 Unique hare reference number, also functions as sex flag. More...
 
int m_experiencedDensity
 State variable used in alternative density-dependent configurations. More...
 
int m_lastYearsDensity
 State variable used in alternative density-dependent configurations. More...
 
int m_ddindex
 State variable used in alternative density-dependent configurations. More...
 
int m_expDensity [365]
 State variable used in alternative density-dependent configurations. More...
 
int m_DensitySum
 State variable used in alternative density-dependent configurations. More...
 
bool m_IamSick
 flag for sickness - used in conjunction with disease configurations More...
 
double m_pesticide_burden
 State variable used to hold the current body-burden of pesticide. More...
 
double m_pesticidedegradationrate
 State variable used to hold the daily degredation rate of the pesticide in the body. More...
 
bool m_pesticideInfluenced1
 Flag to indicate pesticide effects (e.g. can be used for endocrine distruptors with delayed effects until birth). More...
 
- Protected Attributes inherited from TAnimal
int m_Location_x
 
int m_Location_y
 
Landscapem_OurLandscape
 
- Protected Attributes inherited from TALMaSSObject
int m_CurrentStateNo
 The basic state number for all objects - '-1' indicates death. More...
 
bool m_StepDone
 Indicates whether the iterative step code is done for this timestep. More...
 

Detailed Description

Class for young hares (low mobility, milk and solid food inputs)

Constructor & Destructor Documentation

◆ Hare_Young()

Hare_Young::Hare_Young ( int  p_x,
int  p_y,
Landscape p_L,
THare_Population_Manager p_PPM,
double  p_weight 
)

Constructor for Hare_Young.

1718  : Hare_Infant(p_x,p_y,p_L,p_PPM)
1719 {
1720  Init(p_weight);
1721 }
Hare_Infant(int p_x, int p_y, Landscape *p_L, THare_Population_Manager *p_PPM)
Hare infant constructor.
Definition: Hare_all.cpp:1270
void Init()
Object initiation.
Definition: Hare_all.cpp:1285

References Hare_Infant::Init().

◆ ~Hare_Young()

Hare_Young::~Hare_Young ( )
virtual

Destructor for Hare_Young.

1745 {
1746  //Nothing to do
1747 }

Member Function Documentation

◆ BeginStep()

void Hare_Young::BeginStep ( void  )
virtual

BeginStep for Hare_Young.

Resets the day's activity counter and checks for default mortalities and potentially extra mortalities. Calculates energy usage for movement based on todays weight

Reimplemented from Hare_Infant.

1755 {
1756  if (m_CurrentStateNo == -1) return;
1758  // These are all the same value - this may change to so I have kept all three
1759  // for now ver 00005
1767  m_ActivityTime=1440; // Start the day
1768 #ifdef __DDEPMORT
1770 #ifdef __THRESHOLD_DD
1771  if (dens<m_OurPopulationManager->m_HareThresholdDD) dens=0;
1773 #endif
1774  double inter=m_OurPopulationManager->GetInterference(dens);
1775  if (g_rand_uni() > inter) {
1776  ON_Dead();
1777  m_StepDone=true; // We need to skip the step code, we are dead
1778  return;
1779  }
1780 #endif
1782  ON_Dead();
1783  m_StepDone=true; // We need to skip the step code, we are dead
1784  return;
1785  }
1786  // Set the maximum possible energy intake
1788  // Move the hares about if they get scared by a random proximity event
1791  }
1792  CheckManagement();
1793 
1794 }
static CfgFloat cfg_MaxEnergyIntakeScaler("HARE_MAXENERGYINTAKESCALER", CFG_CUSTOM, 3.0)
static CfgFloat cfg_hare_proximity_alert("HARE_PROXIMITY_ALERT", CFG_CUSTOM, 0.05)
boost::variate_generator< base_generator_type &, boost::uniform_real<> > g_rand_uni
CfgInt cfg_hare_escape_dist("HARE_ESCAPE_DIST", CFG_CUSTOM, 100)
double value(void)
Definition: configurator.h:118
int value(void)
Definition: configurator.h:98
virtual void ON_Dead()
This hare has been killed.
Definition: Hare_all.cpp:2206
bool m_StepDone
Indicates whether the iterative step code is done for this timestep.
Definition: PopulationManager.h:118
int m_CurrentStateNo
The basic state number for all objects - '-1' indicates death.
Definition: PopulationManager.h:116
int m_Location_y
Definition: PopulationManager.h:228
int m_Location_x
Definition: PopulationManager.h:225
void CheckManagement(void)
Definition: PopulationManager.cpp:1404
int GetTotalDensity(int x, int y)
Density function - returns the density of all hares in the square containing by x,...
Definition: hare_all.h:676
double m_YoungMortRate
Input variable - Young mortality rate.
Definition: hare_all.h:738
double GetKJperM(int a_size)
Get the cost of moving 1m in KJ dependent upon mass (.
Definition: hare_all.h:626
int m_HareThresholdDD
Input variable - Threshold density dependence level.
Definition: hare_all.h:750
double GetInterference(int h)
Return the proportion of time used in communicating with con-specifics.
Definition: hare_all.h:700
virtual void Running(int a_max_dist)
Run.
Definition: Hare_THare.cpp:152
double m_KJForaging
KJ/m cost of foraging per kg hare.
Definition: hare_all.h:238
double m_old_weight
State variale - last hare weight.
Definition: hare_all.h:185
double GetRMR()
Get todays RMR.
Definition: Hare_THare.cpp:349
int m_ActivityTime
Minutes of potential activity time per day.
Definition: hare_all.h:203
double m_EnergyMax
State variable - the amount of energy it is possible to eat as a multiplyer or RMR.
Definition: hare_all.h:223
double m_KJWalking
KJ/m cost of walking per kg hare.
Definition: hare_all.h:233
double m_weight
State variale - hare weight g.
Definition: hare_all.h:180
double m_KJRunning
KJ/m cost of running per kg hare.
Definition: hare_all.h:228
THare_Population_Manager * m_OurPopulationManager
Pointer to the hare population manager.
Definition: hare_all.h:194

References cfg_hare_escape_dist, cfg_hare_proximity_alert, cfg_MaxEnergyIntakeScaler, TAnimal::CheckManagement(), g_rand_uni, THare_Population_Manager::GetInterference(), THare_Population_Manager::GetKJperM(), THare::GetRMR(), THare_Population_Manager::GetTotalDensity(), THare::m_ActivityTime, TALMaSSObject::m_CurrentStateNo, THare::m_EnergyMax, THare_Population_Manager::m_HareThresholdDD, THare::m_KJForaging, THare::m_KJRunning, THare::m_KJWalking, TAnimal::m_Location_x, TAnimal::m_Location_y, THare::m_old_weight, THare::m_OurPopulationManager, TALMaSSObject::m_StepDone, THare::m_weight, THare_Population_Manager::m_YoungMortRate, ON_Dead(), THare::Running(), CfgInt::value(), and CfgFloat::value().

◆ EndStep()

void Hare_Young::EndStep ( void  )
virtual

EndStep code for Hare_Young.

NB development must be called here because they hares may be still getting milk from Mum.
In EndStep, the home-range centre peg gravitates a little way towards the daily activity area for today.

Reimplemented from Hare_Infant.

1852 {
1855  // Legal returns are:
1856  // tohs_Developing
1857  // tohs_NextStage
1858  // tohs_Dying
1860  }
1861  if (m_CurrentHState==tohs_Dying) {
1862  ON_Dead();
1863  } else MovePeg();
1864 }
CfgBool cfg_hare_pesticideresponse_on("HARE_PESTICIDERESPONSE_ON", CFG_CUSTOM, false)
If set to true then hares will collect and respond to pesticide information. This will slow the simul...
bool value(void)
Definition: configurator.h:135
TTypeOfHareState st_Developing()
Developmental code for the young hare.
Definition: Hare_all.cpp:1938
virtual void InternalPesticideHandlingAndResponse()
Handles internal effects of pesticide exposure. If any effects are needed this method must be re-impl...
Definition: HareForagenPeg.cpp:551
void MovePeg()
Move the peg according to attraction forces.
Definition: HareForagenPeg.cpp:527
TTypeOfHareState m_CurrentHState
Defines the current activity.
Definition: hare_all.h:165
@ tohs_Developing
Definition: hare_all.h:73
@ tohs_Dying
Definition: hare_all.h:79

References cfg_hare_pesticideresponse_on, THare::InternalPesticideHandlingAndResponse(), THare::m_CurrentHState, THare::MovePeg(), ON_Dead(), st_Developing(), tohs_Developing, tohs_Dying, and CfgBool::value().

◆ Init()

void Hare_Young::Init ( double  p_weight)

Object initiation.

1734 {
1735  m_Type = hob_Young;
1736  m_weight = p_weight;
1737  m_Age = 11; // By definition we are 11 days old today
1738 }
Hare_Object m_Type
State variale - the type of hare.
Definition: hare_all.h:175
int m_Age
State variale - hare age.
Definition: hare_all.h:170
@ hob_Young
Definition: hare_all.h:58

References hob_Young, THare::m_Age, THare::m_Type, and THare::m_weight.

◆ ON_Dead()

void Hare_Young::ON_Dead ( void  )
virtual

This hare has been killed.

Housekeeping for removal of the object, lets Mum know if there is a Mum

Reimplemented from Hare_Infant.

2207 {
2208  st_Dying();
2209 }
void st_Dying()
Tidy up before removing the object on death.
Definition: Hare_THare.cpp:172

References THare::st_Dying().

Referenced by BeginStep(), EndStep(), and OnFarmEvent().

◆ OnFarmEvent()

bool Hare_Young::OnFarmEvent ( FarmToDo  event)
protectedvirtual

Response to farm actions.

Checks to see if any nasty farm event has caused the death of the infant.
Currently there is only one response to those events where death is possible. However, this may not always be the case so the code is structured as for the other ALMaSS animals (i.e. it could be a bit easier to overview if it were written differently).

Reimplemented from Hare_Infant.

2000 {
2001  bool result = false;
2002  switch (event)
2003  {
2004  case sleep_all_day:
2005  case glyphosate:
2006  break;
2007  case autumn_plough:
2008  if (random( 100 ) < cfg_hare_y_cut.value()) result = true;
2009  break;
2010  case stubble_plough:
2011  if (random(100) < cfg_hare_y_cut.value()) result = true;
2012  break;
2014  if (random(100) < cfg_hare_y_cut.value()) result = true;
2015  break;
2017  if (random(100) < cfg_hare_y_cut.value()) result = true;
2018  break;
2019  case autumn_harrow:
2020  if (random( 100 ) < cfg_hare_y_cut.value()) result = true;
2021  break;
2022  case preseeding_cultivator:
2023  if (random(100) < cfg_hare_y_cut.value()) result = true;
2024  break;
2026  if (random(100) < cfg_hare_y_cut.value()) result = true;
2027  break;
2028  case autumn_roll:
2029  if (random( 100 ) < cfg_hare_y_cut.value()) result = true;
2030  break;
2031  case autumn_sow:
2032  if (random( 100 ) < cfg_hare_y_cut.value()) result = true;
2033  break;
2034  case winter_plough:
2035  if (random( 100 ) < cfg_hare_y_cut.value()) result = true;
2036  break;
2037  case deep_ploughing:
2038  if (random( 100 ) < cfg_hare_y_cut.value()) result = true;
2039  break;
2040  case spring_plough:
2041  if (random( 100 ) < cfg_hare_y_cut.value()) result = true;
2042  break;
2043  case spring_harrow:
2044  if (random( 100 ) < cfg_hare_y_cut.value()) result = true;
2045  break;
2046  case shallow_harrow:
2047  if (random(100) < cfg_hare_y_cut.value()) result = true;
2048  break;
2049  case spring_roll:
2050  if (random( 100 ) < cfg_hare_y_cut.value()) result = true;
2051  break;
2052  case spring_sow:
2053  if (random( 100 ) < cfg_hare_y_cut.value()) result = true;
2054  break;
2055  case spring_sow_with_ferti:
2056  if (random(100) < cfg_hare_y_cut.value()) result = true;
2057  break;
2058  case fp_npks:
2059  break;
2060  case fp_npk:
2061  break;
2062  case fp_pk:
2063  break;
2064  case fp_liquidNH3:
2065  break;
2066  case fp_slurry:
2067  break;
2068  case fp_ammoniumsulphate:
2069  break;
2070  case fp_manganesesulphate:
2071  break;
2072  case fp_manure:
2073  break;
2074  case fp_greenmanure:
2075  if (random( 100 ) < cfg_hare_y_cut.value()) result = true;
2076  break;
2077  case fp_sludge:
2078  break;
2079  case fp_rsm:
2080  break;
2081  case fp_calcium:
2082  break;
2083  case fa_npk:
2084  break;
2085  case fa_npks:
2086  break;
2087  case fa_pk:
2088  break;
2089  case fa_slurry:
2090  break;
2091  case fa_ammoniumsulphate:
2092  break;
2093  case fa_manganesesulphate:
2094  break;
2095  case fa_manure:
2096  break;
2097  case fa_greenmanure:
2098  break;
2099  case fa_sludge:
2100  break;
2101  case fa_rsm:
2102  break;
2103  case fa_calcium:
2104  break;
2105  case herbicide_treat:
2106  break;
2107  case growth_regulator:
2108  break;
2109  case fungicide_treat:
2110  break;
2112  case trial_toxiccontrol:
2113  case trial_control:
2114  case syninsecticide_treat:
2115  case insecticide_treat:
2116  case product_treat:
2117  break;
2118  case biocide:
2119  break;
2120  case molluscicide:
2121  break;
2122  case row_cultivation:
2123  break;
2124  case strigling:
2125  if (random( 100 ) < cfg_hare_y_cut.value()) result = true;
2126  break;
2127  case hilling_up:
2128  break;
2129  case water:
2130  break;
2131  case swathing:
2132  if (random( 100 ) < cfg_hare_y_cut.value()) result = true;
2133  break;
2134  case harvest:
2135  if (random( 100 ) < cfg_hare_y_cut.value()) result = true;
2136  break;
2137  case cattle_out:
2138  break;
2139  case cattle_out_low:
2140  break;
2141  case cut_to_hay:
2142  if (random( 100 ) < cfg_hare_y_cut.value()) result = true;
2143  break;
2144  case cut_to_silage:
2145  if (random( 100 ) < cfg_hare_y_cut.value()) result = true;
2146  break;
2147  case straw_chopping:
2148  if (random( 100 ) < cfg_hare_y_cut.value()) result = true;
2149  break;
2150  case hay_turning:
2151  if (random( 100 ) < cfg_hare_y_cut.value()) result = true;
2152  break;
2153  case hay_bailing:
2154  if (random( 100 ) < cfg_hare_y_cut.value()) result = true;
2155  break;
2156  case stubble_harrowing:
2157  break;
2159  if (random( 100 ) < cfg_hare_y_cut.value()) result = true;
2160  break;
2161  case burn_straw_stubble:
2162  if (random( 100 ) < cfg_hare_y_cut.value()) result = true;
2163  break;
2164  case mow:
2165  if (random( 100 ) < cfg_hare_y_cut.value()) result = true;
2166  break;
2167  case cut_weeds:
2168  if (random( 100 ) < cfg_hare_y_cut.value()) result = true;
2169  break;
2170  case pigs_out:
2171  result = true;
2172  break;
2173  case strigling_sow:
2174  if (random( 100 ) < cfg_hare_y_cut.value()) result = true;
2175  break;
2176  case strigling_hill:
2177  if (random(100) < cfg_hare_y_cut.value()) result = true;
2178  break;
2179  case bed_forming:
2180  if (random(100) < cfg_hare_y_cut.value()) result = true;
2181  break;
2182  case flower_cutting:
2183  if (random(100) < cfg_hare_y_cut.value()) result = true;
2184  break;
2185  case bulb_harvest:
2186  if (random(100) < cfg_hare_y_cut.value()) result = true;
2187  break;
2188  case straw_covering:
2189  break;
2190  case straw_removal:
2191  break;
2192  default:
2193  m_OurLandscape->Warn( "Hare_Young::OnFarmEvent(): Unknown event type:", m_OurLandscape->EventtypeToString( event ) );
2194  exit( 1 );
2195  }
2196  if (result)
2197  {
2198  ON_Dead();
2199  }
2200  return result;
2201 }
int random(int a_range)
Definition: ALMaSS_CmdLine.cpp:142
CfgInt cfg_hare_y_cut("HARE_CUTTING_MORT_YOUNG", CFG_CUSTOM, 10)
std::string EventtypeToString(int a_event)
Definition: Landscape.cpp:3918
void Warn(std::string a_msg1, std::string a_msg2)
Definition: landscape.h:1579
Landscape * m_OurLandscape
Definition: PopulationManager.h:229
@ burn_straw_stubble
Definition: treatment.h:92
@ autumn_harrow
Definition: treatment.h:37
@ swathing
Definition: treatment.h:81
@ fa_pk
Definition: treatment.h:62
@ winter_plough
Definition: treatment.h:42
@ strigling
Definition: treatment.h:77
@ shallow_harrow
Definition: treatment.h:107
@ straw_removal
Definition: treatment.h:112
@ fp_npks
Definition: treatment.h:48
@ glyphosate
Definition: treatment.h:102
@ fa_sludge
Definition: treatment.h:68
@ fp_liquidNH3
Definition: treatment.h:51
@ spring_roll
Definition: treatment.h:46
@ fa_greenmanure
Definition: treatment.h:67
@ spring_plough
Definition: treatment.h:44
@ fa_rsm
Definition: treatment.h:69
@ molluscicide
Definition: treatment.h:75
@ syninsecticide_treat
Definition: treatment.h:99
@ hay_turning
Definition: treatment.h:88
@ fa_manganesesulphate
Definition: treatment.h:64
@ autumn_roll
Definition: treatment.h:38
@ fp_manure
Definition: treatment.h:55
@ bed_forming
Definition: treatment.h:106
@ deep_ploughing
Definition: treatment.h:43
@ pigs_out
Definition: treatment.h:84
@ fa_npk
Definition: treatment.h:61
@ herbicide_treat
Definition: treatment.h:71
@ row_cultivation
Definition: treatment.h:76
@ heavy_cultivator_aggregate
Definition: treatment.h:108
@ spring_sow
Definition: treatment.h:47
@ fungicide_treat
Definition: treatment.h:73
@ fp_manganesesulphate
Definition: treatment.h:53
@ harvest
Definition: treatment.h:82
@ biocide
Definition: treatment.h:104
@ cut_to_silage
Definition: treatment.h:86
@ sleep_all_day
Definition: treatment.h:33
@ mow
Definition: treatment.h:93
@ preseeding_cultivator
Definition: treatment.h:39
@ fa_ammoniumsulphate
Definition: treatment.h:65
@ autumn_plough
Definition: treatment.h:34
@ straw_chopping
Definition: treatment.h:87
@ fa_manure
Definition: treatment.h:66
@ fp_greenmanure
Definition: treatment.h:56
@ fa_slurry
Definition: treatment.h:63
@ preseeding_cultivator_sow
Definition: treatment.h:40
@ product_treat
Definition: treatment.h:101
@ stubble_harrowing
Definition: treatment.h:90
@ hilling_up
Definition: treatment.h:79
@ straw_covering
Definition: treatment.h:111
@ growth_regulator
Definition: treatment.h:72
@ fp_ammoniumsulphate
Definition: treatment.h:54
@ trial_control
Definition: treatment.h:98
@ fp_rsm
Definition: treatment.h:58
@ stubble_cultivator_heavy
Definition: treatment.h:36
@ insecticide_treat
Definition: treatment.h:74
@ trial_insecticidetreat
Definition: treatment.h:96
@ cattle_out_low
Definition: treatment.h:100
@ cut_to_hay
Definition: treatment.h:85
@ cut_weeds
Definition: treatment.h:94
@ bulb_harvest
Definition: treatment.h:110
@ spring_sow_with_ferti
Definition: treatment.h:103
@ strigling_hill
Definition: treatment.h:105
@ fp_sludge
Definition: treatment.h:57
@ autumn_sow
Definition: treatment.h:41
@ fa_calcium
Definition: treatment.h:70
@ fp_npk
Definition: treatment.h:49
@ fp_pk
Definition: treatment.h:50
@ trial_toxiccontrol
Definition: treatment.h:97
@ hay_bailing
Definition: treatment.h:89
@ spring_harrow
Definition: treatment.h:45
@ strigling_sow
Definition: treatment.h:95
@ stubble_plough
Definition: treatment.h:35
@ cattle_out
Definition: treatment.h:83
@ flower_cutting
Definition: treatment.h:109
@ fp_slurry
Definition: treatment.h:52
@ water
Definition: treatment.h:80
@ fa_npks
Definition: treatment.h:60
@ fp_calcium
Definition: treatment.h:59
@ autumn_or_spring_plough
Definition: treatment.h:91

References autumn_harrow, autumn_or_spring_plough, autumn_plough, autumn_roll, autumn_sow, bed_forming, biocide, bulb_harvest, burn_straw_stubble, cattle_out, cattle_out_low, cfg_hare_y_cut, cut_to_hay, cut_to_silage, cut_weeds, deep_ploughing, Landscape::EventtypeToString(), fa_ammoniumsulphate, fa_calcium, fa_greenmanure, fa_manganesesulphate, fa_manure, fa_npk, fa_npks, fa_pk, fa_rsm, fa_sludge, fa_slurry, flower_cutting, fp_ammoniumsulphate, fp_calcium, fp_greenmanure, fp_liquidNH3, fp_manganesesulphate, fp_manure, fp_npk, fp_npks, fp_pk, fp_rsm, fp_sludge, fp_slurry, fungicide_treat, glyphosate, growth_regulator, harvest, hay_bailing, hay_turning, heavy_cultivator_aggregate, herbicide_treat, hilling_up, insecticide_treat, TAnimal::m_OurLandscape, molluscicide, mow, ON_Dead(), pigs_out, preseeding_cultivator, preseeding_cultivator_sow, product_treat, random(), row_cultivation, shallow_harrow, sleep_all_day, spring_harrow, spring_plough, spring_roll, spring_sow, spring_sow_with_ferti, straw_chopping, straw_covering, straw_removal, strigling, strigling_hill, strigling_sow, stubble_cultivator_heavy, stubble_harrowing, stubble_plough, swathing, syninsecticide_treat, trial_control, trial_insecticidetreat, trial_toxiccontrol, CfgInt::value(), Landscape::Warn(), water, and winter_plough.

◆ ReInit()

void Hare_Young::ReInit ( struct_Hare  a_data)

Young object reinitiation.

1723 {
1724  m_Location_x = a_data.x;
1725  m_Location_y = a_data.y;
1726  m_OurLandscape = a_data.L;
1727  m_CurrentStateNo = 0;
1728  THareInit(a_data.x, a_data.y, a_data.HM);
1729  Init(a_data.weight);
1730 }
void THareInit(int p_x, int p_y, THare_Population_Manager *p_PPM)
Object Initiation.
Definition: Hare_THare.cpp:72
int y
Definition: hare_all.h:138
int x
Definition: hare_all.h:137
Landscape * L
Definition: hare_all.h:140
double weight
Definition: hare_all.h:144
THare_Population_Manager * HM
Definition: hare_all.h:141

References struct_Hare::HM, Hare_Infant::Init(), struct_Hare::L, TALMaSSObject::m_CurrentStateNo, TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, THare::THareInit(), struct_Hare::weight, struct_Hare::x, and struct_Hare::y.

Referenced by THare_Population_Manager::CreateObjects().

◆ st_Developing()

TTypeOfHareState Hare_Young::st_Developing ( )
protected

Developmental code for the young hare.

1939 {
1940  // This code must be called by the EndStep
1941  // NB foraged food and milk are in the same energetic currency
1943  if (m_TodaysEnergy>me) m_TodaysEnergy=me;
1945  m_weight+=growth;
1946  // We need to know whether the growth rate is positive or negative
1947 //#ifndef __MINGROWTHATTAIN
1950  return tohs_Dying;
1951  }
1952 //#endif
1953  // Make sure m_TodaysEnergy is zero;
1954  m_TodaysEnergy=0;
1955  if (++m_Age>34) {
1956  return tohs_NextStage;
1957  }
1958 #ifdef __MINGROWTHATTAIN
1959  // Take a check on our growth - if we are below 90% of the min repro weight, assume we died
1960  //if (m_weight < (cfg_hare_minimum_breeding_weight.value()*cfg_min_growth_attain.value())) return tohs_Dying;
1961  if (m_weight< m_OurPopulationManager->m_DMWeight[m_Age]) return tohs_Dying;
1962 #endif
1963  return tohs_Foraging;
1964 }
static CfgInt cfg_young_starvation_threshold("HARE_YOUNG_STARVE_THRESHOLD", CFG_CUSTOM, 4)
double GetGrowthEfficiencyP(int a_age)
Get the growth efficiency for this a_age for creating protein.
Definition: hare_all.h:602
double GetMaxDailyGrowthEnergyP(int a_age)
Get the maximum daily energy needed for growth for this a_age for use in protein construction.
Definition: hare_all.h:565
double m_TodaysEnergy
State variable - the amount of energy available today, can be in deficit.
Definition: hare_all.h:218
int m_StarvationDays
State variable - the number of consecutive days in negative energy balance.
Definition: hare_all.h:208
@ tohs_Foraging
Definition: hare_all.h:75
@ tohs_NextStage
Definition: hare_all.h:72

References cfg_young_starvation_threshold, THare_Population_Manager::GetGrowthEfficiencyP(), THare_Population_Manager::GetMaxDailyGrowthEnergyP(), THare::m_Age, THare::m_old_weight, THare::m_OurPopulationManager, THare::m_StarvationDays, THare::m_TodaysEnergy, THare::m_weight, tohs_Dying, tohs_Foraging, tohs_NextStage, and CfgInt::value().

Referenced by EndStep().

◆ st_Dispersal()

TTypeOfHareState Hare_Young::st_Dispersal ( )
protectedvirtual

Not used.

Unused at present

Reimplemented from THare.

1917 {
1918  // This behavioural state is not used at present
1919  return tohs_Foraging;
1920 }

References tohs_Foraging.

Referenced by Step().

◆ st_Foraging()

TTypeOfHareState Hare_Young::st_Foraging ( )
protected

Young foraging.

The amount of time spent on this is dependent upon age. They can take in food up to a proportion of their needs increasing with age. This gives us a little problem because we don't explicitly define their needs. We assume therefore that the milk supply is maximal and that the the time available is all day - but that the max solid food intake possible is defined by age, following the data from Hacklander - this gives no flexibility in the proportion of max food but will cause differential growth w.r.t. milk supply.

1877 {
1878 
1879  double time=m_ActivityTime;
1881  // We need to rest if there is no more time
1882  if (time < 30) return tohs_Resting;
1883  //time+=m_TimePerForageSquare;
1884  // time now has the time to use foraging
1885  // Given the time we have then we need to feed, which will return an energy
1886  // Value obtained.
1887  // m_TodaysEnergy is zero on entry, except in the case where the young were
1888  // created today. So we can't use m_TodaysEnergy directly
1889  int a_time = (int) time;
1890  double ForageEnergy;
1892  {
1893  ForageEnergy = ForageP(a_time);
1894  }
1895  else
1896  {
1897  ForageEnergy = Forage(a_time);
1898  }
1899  // We need to spend energy on foraging and associated movement
1900  //
1901  TimeBudget(activity_Foraging, (int)time-a_time);
1902  //
1904  // If we got too much then cap it
1905  if (ForageEnergy>Target) ForageEnergy=Target;
1906 #ifdef __NOSTARVE
1907  ForageEnergy=Target;
1908 #endif
1909  m_TodaysEnergy+=ForageEnergy;// pre-calculated in the ForageEnergy // *cfg_solidAsbsorption.value();
1910  return tohs_Resting;
1911 }
const double g_PropSolidFood[36]
Definition: Hare_all.cpp:289
const double g_MaxLeveretGrowthEnergy[36]
Definition: Hare_all.cpp:300
CfgFloat cfg_ForageRestingRatio("HARE_FORAGERESTRATIO", CFG_CUSTOM, 0.67)
double GetRMR(int a_age, double a_size)
Returns the RMR given a specific age and mass.
Definition: Hare_all.cpp:1034
double Forage(int &time)
Foraging.
Definition: HareForagenPeg.cpp:54
void TimeBudget(TTypeOfActivity a_activity, int dist)
Adjust time budger for an activity.
Definition: Hare_THare.cpp:314
double GetTotalWeight()
Provide the wet weight of the hare.
Definition: hare_all.h:370
double ForageP(int &time)
Foraging but also incorporating pesticide exposure.
Definition: HareForagenPeg.cpp:181
@ activity_Foraging
Definition: hare_all.h:92
@ tohs_Resting
Definition: hare_all.h:76

References activity_Foraging, cfg_ForageRestingRatio, cfg_hare_pesticideresponse_on, THare::Forage(), THare::ForageP(), g_MaxLeveretGrowthEnergy, g_PropSolidFood, THare_Population_Manager::GetRMR(), THare::GetTotalWeight(), THare::m_ActivityTime, THare::m_Age, THare::m_OurPopulationManager, THare::m_TodaysEnergy, THare::TimeBudget(), tohs_Resting, CfgFloat::value(), and CfgBool::value().

Referenced by Step().

◆ st_NextStage()

void Hare_Young::st_NextStage ( )
protected

Maturation to Hare_Juvenile.

Young 'matures' to become a Hare_Juvenile.

This creats a Hare_Juvenile object via a call to create objects, then sets the flag for destruction of this object.

1971 {
1976  struct_Hare* sp;
1977  sp = new struct_Hare;
1978  sp->HM = m_OurPopulationManager;
1979  sp->L = m_OurLandscape;
1980  sp->x = m_Location_x;
1981  sp->y = m_Location_y;
1982  sp->weight = m_weight;
1983  // Mum no longer cares about the young, it is too old
1984  // Removal of the young from Mum's list
1985  if (m_MyMum!=NULL) m_MyMum->ON_RemoveYoung(this);
1986  // If m_MyMum is NULL then it means that she deserted the young but they survived anyway
1987  m_MyMum=NULL;
1988  m_OurPopulationManager->CreateObjects(2,this,NULL,sp,1);
1989  // Clean-up
1990  m_CurrentStateNo=-1; // Destroys the object at the next opportunity
1992  delete sp;
1993 }
void ON_RemoveYoung(THare *a_young)
A leveret has matured.
Definition: Hare_all.cpp:3901
void CreateObjects(int ob_type, TAnimal *pvo, void *null, struct_Hare *data, int number)
Method used to create new hares.
Definition: Hare_all.cpp:928
Hare_Female * m_MyMum
Pointer to the hare's mum.
Definition: hare_all.h:190
Class used to pass hare information to CreateObjects.
Definition: hare_all.h:135
@ tohs_DestroyObject
Definition: hare_all.h:80

References THare_Population_Manager::CreateObjects(), struct_Hare::HM, struct_Hare::L, THare::m_CurrentHState, TALMaSSObject::m_CurrentStateNo, TAnimal::m_Location_x, TAnimal::m_Location_y, THare::m_MyMum, TAnimal::m_OurLandscape, THare::m_OurPopulationManager, THare::m_weight, Hare_Female::ON_RemoveYoung(), tohs_DestroyObject, struct_Hare::weight, struct_Hare::x, and struct_Hare::y.

Referenced by Step().

◆ st_Resting()

TTypeOfHareState Hare_Young::st_Resting ( )
protected

Resting.

Just uses some time and energy sitting around. The time used is important because it removes time for foraging.

1927 {
1928  // TODO Need to find a position - use some energy walking too?
1929  EnergyBalance(activity_Resting, 0); // Just removes a days BMR
1931  return tohs_Developing;
1932 }
void EnergyBalance(TTypeOfActivity a_activity, int dist)
Adjust energy balance for an activity.
Definition: Hare_THare.cpp:277
@ activity_Resting
Definition: hare_all.h:90

References activity_Resting, THare::EnergyBalance(), THare::m_ActivityTime, THare::TimeBudget(), and tohs_Developing.

Referenced by Step().

◆ Step()

void Hare_Young::Step ( void  )
virtual

Step code for Hare_Young.

Reimplemented from Hare_Infant.

1802 {
1803  if (m_StepDone || m_CurrentStateNo == -1) return;
1804  switch (m_CurrentHState)
1805  {
1806  case tohs_InitialState: // Initial state
1808  break;
1809  case tohs_Dispersal:
1810  // Legal returns are:
1811  // tohs_YResting
1812  // tohs_YForaging
1814  break;
1815  case tohs_Foraging:
1816  // Legal returns are:
1817  // tohs_YResting
1819  break;
1820  case tohs_Resting:
1821  // Legal returns are:
1822  // tohs_YDeveloping
1824  break;
1825  case tohs_Developing:
1826  m_StepDone=true;
1827  break;
1828  case tohs_NextStage:
1829  // Legal returns are:
1830  // NONE
1831  st_NextStage();
1832  m_StepDone=true;
1833  break;
1834  case tohs_Dying:
1835  m_StepDone=true;
1836  break;
1837  default:
1838  m_OurLandscape->Warn("Hare_Young::Step - unknown state",NULL);
1839  exit(1);
1840  }
1841 }
void st_NextStage()
Maturation to Hare_Juvenile.
Definition: Hare_all.cpp:1970
TTypeOfHareState st_Dispersal()
Not used.
Definition: Hare_all.cpp:1916
TTypeOfHareState st_Resting()
Resting.
Definition: Hare_all.cpp:1926
TTypeOfHareState st_Foraging()
Young foraging.
Definition: Hare_all.cpp:1876
@ tohs_InitialState
Definition: hare_all.h:71
@ tohs_Dispersal
Definition: hare_all.h:74

References THare::m_CurrentHState, TALMaSSObject::m_CurrentStateNo, TAnimal::m_OurLandscape, TALMaSSObject::m_StepDone, st_Dispersal(), st_Foraging(), st_NextStage(), st_Resting(), tohs_Developing, tohs_Dispersal, tohs_Dying, tohs_Foraging, tohs_InitialState, tohs_NextStage, tohs_Resting, and Landscape::Warn().


The documentation for this class was generated from the following files: